<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<f:view contentType="text/html">
	<h:head>
		<style type="text/css">@import url(../css/estilo.css);</style>
	</h:head>
	<h:body>
		<p:layout fullPage="true">

			<p:layoutUnit position="top" height="175" id="top_layout" resizable="false"
				closable="false" collapsible="false">
				<div align="center"><img src="../imagens/chamado_user.png"
					width="1000"></img></div>
			</p:layoutUnit>

			<p:layoutUnit position="bottom" height="30"
				header="Desenvolvido por André Ricardo Gnhoato • João Carlos V. Siqueira • Lubian Carmona • ©2011"
				resizable="false" closable="false" collapsible="true">
			</p:layoutUnit>

			<p:layoutUnit position="left" width="200" header="Menu"
				resizable="true" closable="false" collapsible="true">
				<h:form>
					
					<p:menu style="width:180px">
					<p:submenu label="Home">
						<p:menuitem value="Chamadas" action="User?faces-redirect=true" ajax="false" />
					</p:submenu>
						<p:submenu label="Chamadas" icon="ui-icon ui-icon-refresh">
							<p:menuitem value="Nova"
								action="#{chamadaController.novaChamada}" ajax="false"
								icon="ui-icon ui-icon-contact" />
						</p:submenu>
						<p:submenu label="Usuário" ajax="false" >
							<p:menuitem value="Bem-vindo: #{UsuarioController.usuario.login}"/>
							<p:menuitem value="Sair" action="#{UsuarioController.logout}" ></p:menuitem>
						</p:submenu>
					</p:menu>
				</h:form>


			</p:layoutUnit>

			<!--    <p:layoutUnit position="right" width="200" header="Right" resizable="true" closable="true" collapsible="true">  -->
			<!--        <h:outputText value="East unit content." />  -->
			<!--    </p:layoutUnit>  -->

			<p:layoutUnit position="center" scrollable="true">
				<h:form id="formCadastro">
					<p:panel id="panelCadastro" header="Chamadas"
						style="margin-bottom:10px;">
						<p:messages />

						<h:panelGrid id="panel1" columns="2">
							<h:outputLabel for="descricao" value="Descrição: " />
							<p:message for="descricao" display="icon" />
							<p:inputTextarea id="descricao"
								value="#{chamadaController.chamada.descricao}" required="true"
								requiredMessage="Descrição: Campo Obrigatório"
								style="width:700px" />
						</h:panelGrid>
						<h:panelGrid id="panel2" columns="3">
							<h:outputLabel for="data" value="Data: " />
							<p:calendar id="data" effect="fade" showOn="button"
								value="#{chamadaController.data}" required="true"
								requiredMessage="Data: Campo Obrigatório" />
							<p:message for="data" display="icon" />

							<h:outputLabel for="categoria" value="Categoria: " />
							<h:selectOneMenu id="categoria"
								binding="#{chamadaController.categorias}" required="true"
								requiredMessage="Categoria: Campo Obrigatório">
								<f:selectItem itemLabel="Selecione" />
								<f:selectItems value="#{chamadaController.categoriasParaCombo}" />
							</h:selectOneMenu>
							<p:message for="categoria" display="icon" />

							<h:outputLabel for="prioridade" value="Prioridade: " />
							<h:selectOneMenu id="prioridade" required="true"
								binding="#{chamadaController.prioridades}"
								requiredMessage="Prioridade: Campo Obrigatório">
								<f:selectItem itemLabel="Selecione" />
								<f:selectItems value="#{chamadaController.prioridadesParaCombo}" />
							</h:selectOneMenu>
							<p:message for="prioridade" display="icon" />
						</h:panelGrid>
						<p:separator />
						<p:commandButton value="Salvar" image="ui-icon ui-icon-disk"
							action="#{chamadaController.cadastrarChamada}"
							update="panelCadastro">
						</p:commandButton>
					</p:panel>
				</h:form>
			</p:layoutUnit>

		</p:layout>
		<div id="logo"></div>
	</h:body>
</f:view>
</html>
